﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Upeu.Venta.Data.Business;
using Upeu.Venta.Data.Entities;

namespace Upeu.Venta.Data.Test.Business
{
    [TestClass]
    public class ProveedorBusinessTest
    {
        /* yuri mamani ramos crud Proveedores*/

        [TestMethod]
        public void TestGetListByFilter()
        {
            var lista = ProveedorBusiness.GetListByFilter("");
            Assert.IsTrue(lista.Count > 0);
        }

        [TestMethod]
        public void TestCreate()
        {
            Proveedor nuevo = new Proveedor
            {
                Nombre = "Mirian",
                RazonSocial = "sac produc",
                Ruc = "024567",
                Direccion = "juliaca",
                Telefono = 904567,
                Celular = 990425529,
                Estado = 0,

            };
            Proveedor c = ProveedorBusiness.Create(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }

        [TestMethod]
        public void TestUpdate()
        {
            Proveedor nuevo = new Proveedor
            {
                Id = new Guid("17f1f0b2-99df-e411-84bc-e069958900b1"),
                Nombre = "Pablo 2",
                RazonSocial = "sac pmay",
                Ruc = "024558",
                Direccion = "puno",
                Telefono = 970567,
                Celular = 990215529,
                Estado = 0,

            };
            Proveedor c = ProveedorBusiness.Update(nuevo);
            Assert.IsTrue(c.Id != Guid.Empty);
        }
    }
}
